package org.stone.project.common.pojo.sysEnum;

/**
 * 系统枚举模板
 */

import org.stone.project.common.pojo.annotation.MarkEnum;

/**
 * 枚举模板
 */
@MarkEnum("codeTemplate")
public enum CodeTemplate {
    ;
    private Integer code;
    private String describStr;

    CodeTemplate(Integer code, String describStr) {
        this.code = code;
        this.describStr = describStr;
    }


    public Integer getCode() {
        return code;
    }

    public String getDescribStr() {
        return describStr;
    }


    /**
     * 根据code获取实例
     * @param code
     * @return
     */
    public static CodeTemplate getInstance(Integer code){
        if (code == null)
            return null;
        for (CodeTemplate value : values()) {
            if (value.getCode().equals(code))
                return value;
        }
        return null;
    }
}
